using System;
using System.Collections.Generic;

using TnPlus.Entities.Utils;
using TnPlus.Entities.Models;
using TnPlus.DAL;
using TnPlus.Common;

namespace TnPlus.Biz
{
	public class CashHistoryService
	{
		/// <summary>
		/// Saves a record to the CashHistory table.
		/// </summary>
		public virtual void Insert(CashHistoryInfo cashHistoryInfo)
		{
			try
			{
				new CashHistoryDAO().Insert(cashHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.CashHistory - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the CashHistory table.
		/// </summary>
		public virtual void Update(CashHistoryInfo cashHistoryInfo)
		{
			try
			{
				new CashHistoryDAO().Update(cashHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.CashHistory - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the CashHistory table.
		/// </summary>
		public virtual void Delete(Guid? idCash)
		{
			try
			{
				new CashHistoryDAO().Delete(idCash);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.CashHistory - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the CashHistory table.
		/// </summary>
		public virtual CashHistoryInfo Select(Guid? idCash)
		{
			try
			{
				return new CashHistoryDAO().Select(idCash);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.CashHistory - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the CashHistory table.
		/// </summary>
		public List<CashHistoryInfo> SelectAll()
		{
			try
			{
				return new CashHistoryDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.CashHistory - SelectAll", ex);
				throw;
			}

		}

	}
}
